package com.wfh.mianshiji.manager;

import com.wfh.mianshiji.config.MinioConfig;
import io.minio.MinioClient;
import jakarta.annotation.Resource;
import org.springframework.context.annotation.Bean;
import org.springframework.stereotype.Component;

/**
 * @Title: MinioManager
 * @Author wangfenghuan
 * @Package com.wfh.mianshiji.manager
 * @Date 2025/10/31 10:25
 * @description:
 */
@Component
public class MinioManager {

    @Resource
    private MinioConfig minioConfig;

    @Bean
    public MinioClient minioClient(){
        return MinioClient.builder()
                .endpoint(minioConfig.getEndpoint())
                .credentials(minioConfig.getAccessKey(), minioConfig.getSecretKey()).build();
    }
}
